home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / graphics / n-z / raystorexa / arexx / bounce.ray < prev    next >
Text File  |  1995-10-22  |  2KB  |  90 lines

  1. /***************
  2.  * NAME:        bounce.ray
  3.  * VERSION:     1.0 08.10.95
  4.  * DESCRIPTION: Tutorial: bouncing ball
  5.  * AUTHOR:      Andreas Heumann
  6.  * BUGS:        none
  7.  * TO DO:       nothing
  8.  * HISTORY:
  9.  *    DATE     NAME  COMMENT
  10.  *    08.10.95 ah    initial release
  11.  ***************/
  12.  
  13. signal on error
  14.  
  15. options results
  16.  
  17. IF ~show('P','RAYSTORM') THEN DO
  18.   address COMMAND 'run >NIL: <NIL: /RayStorm'
  19.   address COMMAND WaitForPort RAYSTORM
  20. END  
  21.  
  22. address RAYSTORM
  23.  
  24. frames = 17
  25. g = .2
  26.  
  27. 'BRUSHPATH /brushes'
  28. 'TEXTUREPATH /textures'
  29.  
  30. 'SETSCREEN 160 128'
  31. 'SETCAMERA <0,10,40> <0,5,0> <0,1,0> 25 20'
  32. 'POINTLIGHT <5,20,20>'
  33. 'SETWORLD [10,30,200] [10,10,10]'
  34.  
  35. 'NEWACTOR groundactor'
  36. 'ALIGNMENT 0 ' frames+2 ' <0,0,360>'
  37.  
  38. 'NEWSURFACE groundtop'
  39. 'DIFFUSE [255,255,255]'
  40. 'SPECULAR [0,0,0]'
  41. 'REFLECT [50,50,50]'
  42. 'IMTEXTURE checker.itx <0,-1,0> <0,0,0> <1.5,1.5,1.5> ACTOR groundactor'
  43.  
  44. 'NEWSURFACE groundbottom'
  45. 'DIFFUSE [255,0,0]'
  46. 'SPECULAR [0,0,0]'
  47. 'REFLECT [50,50,50]'
  48. 'IMTEXTURE checker.itx <0,-1,0> <0,0,0> <1.5,1.5,1.5> ACTOR groundactor'
  49.  
  50. 'TRIANGLE groundtop <-2,0,-2> <2,0,-2> <2,0,2> ACTOR groundactor'
  51. 'TRIANGLE groundtop <-2,0,-2> <-2,0,2> <2,0,2> ACTOR groundactor'
  52. 'TRIANGLE groundbottom <-2,-.01,-2> <2,-.01,-2> <2,-.01,2> ACTOR groundactor'
  53. 'TRIANGLE groundbottom <-2,-.01,-2> <-2,-.01,2> <2,-.01,2> ACTOR groundactor'
  54.  
  55. speed = -g
  56. pos = 10
  57. 'NEWACTOR ballactor <0,'pos',0>'
  58. do i=0 to frames
  59.   'POSITION 'i i+1' <0,'pos',0>'
  60.   pos = pos+speed
  61.   if pos<=1 & speed<0 then
  62.     speed = -speed
  63.   else
  64.     speed = speed-g
  65. end
  66. 'ALIGNMENT 0 ' frames+2 ' <0,360,0>'
  67.  
  68. 'NEWSURFACE ball'
  69. 'BRUSH earth.iff COLOR WRAPXY <0,10,0> <0,0,0> <.1,.1,.1> ACTOR ballactor'
  70.  
  71. 'SPHERE ball <0,10,0> 1 ACTOR ballactor'
  72.  
  73. 'ANTIALIAS 1'
  74. 'DISTRIB 2'
  75.  
  76. do i=0 to frames
  77.   'STARTRENDER QUICK FROM 'i' TO 'i+1
  78.   'SAVEPIC bounce' || RIGHT(i+1,4,0) || '.iff'
  79. end
  80.  
  81. 'CLEANUP'
  82.  
  83. exit 0
  84.  
  85. error:
  86. say "Error" rc "in line" sigl ":"
  87. GETERRORSTR rc
  88. say result
  89. exit 0
  90.